//这里定义一些全局通用的函数，该文件会被自动加载

var request = require('request');

global.getBaiduPage = function(self) {
	return function(resolve, reject) {
		request('http://www.baidu.com', function (error, response, body) {
			if (!error && response.statusCode == 200) {
				self.session.html = body;
				resolve();
			}
		});
	}
};